How to add a Status Bar to a dialog using PBForms to create the foundation code.
====================================================================================

1. Create a dialog with the following styles:
    %WS_POPUP
    %WS_BORDER
    %WS_DLGFRAME
    %WS_THICKFRAME
    %WS_CAPTION
    %WS_SYSMENU
    %WS_MINIMIZEBOX
    %WS_MAXIMIZEBOX
    %WS_CLIPSIBLINGS
    %DS_MODALFRAME

2. Add a custom control to the dialog, and position at the bottom of the dialog, 12 dialog units high, and as wide as the dialog.  Note the absolute position and size of the control is not important, as it is resized and located automatically at runtime.

3. Set the Class Name of the custom control to "msctls_statusbar32" (without the quotes).  Do not set any primary styles.

4. Add menus to the dialog, and be sure to include Prompt Strings for each Menu Item.  These will ultimately be displayed in the Status Bar as the mouse/keyboard highlights (hovers) over menu items.

5. Save the project and open it in IDE.

6. Just below #PBForms End Includes, add the following line:

    #INCLUDE "COMMCTRL.INC"
    #INCLUDE "PBForms.INC"

7. In PBMAIN, just before the call to ShowDIALOG1, add the following code:

    PBFormsInitComCtls (%ICC_WIN95_CLASSES)

8. Add a a %WM_INITDIALOG handler as follows:

    CASE %WM_INITDIALOG
        DIALOG POST CBHNDL, %WM_SIZE, 0, 0

8. In the dialog callback, add a %WM_SIZE handler as follows:

    CASE %WM_SIZE
        CONTROL SEND CBHNDL, %IDC_CUSTOMCONTROL1, CBMSG, 0, 0
        FUNCTION = 1

9. In the dialog callback, add a %WM_MENUSELECT handler, as follows:

    CASE %WM_MENUSELECT
        STATIC szText AS ASCIIZ * %MAX_PATH
        IF ISFALSE LoadString(GetModuleHandle(BYVAL 0&), CBCTL, _
            szText, SIZEOF(szText)) THEN _
            szText = "Please choose from the menus above..."
        CONTROL SEND CBHNDL, %IDC_CUSTOMCONTROL1, %WM_SETTEXT, 0, VARPTR(szText)
        FUNCTION = 1


10. In the ShowDiALOG1 function, add the following lines just below the #PBForms End Dialog statement, and before the DIALOG SHOW MODAL statement:

    LOCAL hStatus AS LONG
    CONTROL HANDLE hDlg, %IDC_CUSTOMCONTROL1 TO hStatus
    SetWindowLong hStatus, %GWL_STYLE, _
        (GetWindowLong(hStatus, %GWL_STYLE) OR %SBARS_SIZEGRIP)

11. Finished!  When the project is run, the status bar will have created its own corner size grip, and the status bar automatically resizes when the dialog is resized.
